<?php $productFullName = $this->brand->getTitle() . ' ' . $this->product->getTitle();?>
<?php $categoryTitle = $this->category->getTitle();?>

<?php $this->headTitle()->append($categoryTitle); ?>
<?php $this->headTitle()->append($productFullName); ?>
<?php $this->description[] = $productFullName;?>
<?php array_push($this->keywords, $productFullName, 'характеристики', 'обзор', 'цена', 'купить', 'скачать', 'драйвера', 'прошивка', 'бесплатно', $categoryTitle);?>
<?php $this->activeCategory = $this->category->getAlias();?>

<?php $this->headLink()->appendStylesheet('/js/jquery/stars/jquery.ui.stars.min.css'); ?>
<?php $this->headLink()->appendStylesheet('/js/jquery/colorbox/colorbox.css'); ?>

<?php $this->headScript()->appendFile('/js/jquery/stars/jquery.ui.stars.min.js'); ?>
<?php $this->headScript()->appendFile('/js/jquery/colorbox/jquery.colorbox-min.js'); ?>
<?php $this->headScript()->appendFile('/recaptcha/recaptcha_ajax.js');?>
<?php $this->headScript()->appendFile('http://userapi.com/js/api/openapi.js?34');?>

<?php $fullProductName = $this->brand->getTitle() . ' ' . $this->product->getTitle();?>
<div class="title01-top"></div>
<div class="title01">
	<div class="title01-in">
		<h3 class="ico-info">Описание&nbsp;<?php echo $fullProductName;?></h3>
	</div>
</div>
<div class="title01-bottom"></div>

<p class="bb nomt">
	<a href="/">Главная</a> &raquo;
	<?php if (!empty($this->parentCategory)):?>
		<a href="<?php echo $this->url(array('module' => 'catalog', 'controller' => 'categories', 'action' => 'list'), null, true);?>/category/<?php echo $this->parentCategory->getAlias();?>"><?php echo $this->parentCategory->getTitle();?></a> &raquo;
	<?php endif;?>
	<strong><?php echo $this->category->getTitle();?></strong>
</p>

<?php if (!empty($this->categories)):?>
	<!-- Subcategories -->
	<h4>Разделы, в которые входит <?php echo $productFullName;?></h4>
	<ul class="ul-categories box bb">
	<?php foreach ($this->categories as $category):?>
		<li><a href="<?php echo $this->url(array('module' => 'catalog', 'controller' => 'categories', 'action' => 'list'), null, true);?>/category/<?php echo $category->CATEGORIES_ALIAS;?>"><?php echo $category->CATEGORIES_TITLE;?></a> (<?php echo isset($this->catsProdsCnt[$category->CATEGORIES_ID]) ? $this->catsProdsCnt[$category->CATEGORIES_ID] : 0;?>)</li>
	<?php endforeach;?>
	</ul>
<?php endif;?>

<script type="text/javascript">
	$(document).ready(function(){
		$("a[rel='photos']").colorbox({
			transition:"elastic",
			current : "{current} из {total}"
		});
	});
</script>


<div id="productDescr">
	<table class="width100">
		<tr>
			<td class="imgBox">
			<?php if (!empty($this->photos)):?>
				<?php foreach ($this->photos as $photo):?>
					<?php if ($photo->PHOTOS_ISDEFAULT):?>
					<a href="<?php echo $photo->PHOTOS_FILE?>" rel="photos" title="<?php echo $productFullName;?>">
					<img src="/timthumb/timthumb.php?src=<?php echo $photo->PHOTOS_FILE?>&w=180&zc=0" alt="<?php echo $productFullName;?>"/>
					</a>
					<?php else:?>
					<a href="<?php echo $photo->PHOTOS_FILE?>" rel="photos" title="<?php echo $productFullName;?>"></a>
					<?php endif;?>
				<?php endforeach;?>
			<?php else:?>
				<img src="/images/catalogio/noImg180.jpg" alt="<?php echo $productFullName;?>" width="180" height="135"/>
			<?php endif;?>
			</td>
			<td style="min-width:200px;">
				<table>
				<?php if ($this->brand->getUrl()):?>
					<tr class="bb">
						<td colspan="2">
							<noindex><a href="<?php echo $this->brand->getUrl();?>" rel="nofollow" target="_blank" class="bigger strong nonhigh">Сайт производителя</a></noindex>
						</td>
					</tr>
				<?php endif;?>
				<?php if ($this->product->getUrl()):?>
					<tr class="bb">
						<td colspan="2">
							<noindex><a href="<?php echo $this->product->getUrl();?>" rel="nofollow" target="_blank" class="bigger strong high">Скачать драйвера с depositfiles.com</a></noindex>
						</td>
					</tr>
				<?php endif;?>
				<?php if ($this->product->getDriversUrl()):?>
					<tr class="bb">
						<td colspan="2">
							<noindex><a href="<?php echo $this->product->getDriversUrl();?>" rel="nofollow" target="_blank" class="bigger strong high">Скачать драйвера с letitbit.net</a></noindex>
						</td>
					</tr>
				<?php endif;?>
					<tr class="bb">
						<td colspan="2">
							<script type="text/javascript" src="//yandex.st/share/share.js" charset="utf-8"></script>
							<div class="yashare-auto-init" data-yashareType="link" data-yashareQuickServices="yaru,vkontakte,facebook,odnoklassniki,moimir"></div>
						</td>
					</tr>
				</table>
			</td>
			<td>
				<script type="text/javascript" language="Javascript" src="http://a.ava.com.ua/a/showA.js?partner=335&block=698&search=<?php echo $productFullName;?>&encoding=utf8&limit=5"></script>
			</td>
		</tr>
	</table>
	<div id="descrBody" class="box">
		<div id="shortDescr"><?php echo $this->product->getShortDescr();?></div>
	</div>
	<br />

	<div class="descr-panes" id="prodTabs">
		<noindex>
		<ul class="descr-tabs">
			<li><a href="#prices">Цены в магазинах</a></li>
			<li><a href="#prodCustomDescr">Технические характеристики</a></li>
			<li><a href="/catalog/products/shprices/product/<?php echo $this->product->getAlias();?>/format/html" rel="nofollow">Продам Б/У</a></li>
			<li><a href="/catalog/products/comments/product/<?php echo $this->product->getAlias();?>/format/html" rel="nofollow">Комментарии</a></li>
		</ul>
		</noindex>
		<div id="prices">
		<?php foreach ($this->mixOffers as $offer):?>
			<div class="bb" style="margin:5px 0;font-size:0.9em;">
				<table>
					<tr>
						<td rowspan="6" width="100px">
							<a href="<?php echo $offer->OFFERS_URL?>" rel=”nofollow” target="_blank"><img src="<?php echo empty($offer->OFFERS_IMG) ? '/images/catalogio/noImg90.jpg' : $offer->OFFERS_IMG?>" width="<?php echo empty($offer->OFFERS_IMGW) ? 90 : $offer->OFFERS_IMGW;?>" height="<?php echo empty($offer->OFFERS_IMGH) ? 67 : $offer->OFFERS_IMGH;?>" /></a>
						</td>
						<th style="text-align:left;">
							<a href="<?php echo $offer->OFFERS_URL?>" rel=”nofollow” target="_blank" class="bigger strong high"><?php echo $offer->OFFERS_NAME?></a>
						</th>
					</tr>
					<tr>
						<td><?php if ($offer->OFFERS_CURRENCYID == 'RUB') { $currencyType = 'руб.';} else if ($offer->OFFERS_CURRENCYID == 'UAH') {$currencyType = 'грн.';} else {$currencyType = '$';}?>
							<em>Цена</em>: <a href="<?php echo $offer->OFFERS_URL?>" rel=”nofollow” target="_blank" class="bigger strong"><?php echo $offer->OFFERS_PRICE . $currencyType;?></a>
						</td>
					</tr>
					<tr>
						<td>
							<em>Магазин</em>: <a href="<?php echo $offer->OFFERS_URL?>" rel=”nofollow” target="_blank"><?php echo $offer->ADVERTIZERS_TITLE?></a>
						</td>
					</tr>
					<?php if (!empty($offer->REGIONSGEOTAGRET_TITLE)):?>
						<tr><td><em>Регион</em>: <b><?php echo $offer->REGIONSGEOTAGRET_TITLE;?></b></td></tr>
					<?php endif;?>
					<tr>
						<td>
							<em>Описание</em>: <?php echo empty($offer->OFFERS_DESC) ? $offer->OFFERS_NAME : mb_substr($offer->OFFERS_DESC, 0, 400, 'utf-8');?>
						</td>
					</tr>
					<tr>
						<td><a href="<?php echo $offer->OFFERS_URL?>" rel=”nofollow” target="_blank">Купить в магазине <b><?php echo $offer->ADVERTIZERS_TITLE;?></b> >></a></td>
					</tr>
				</table>
			</div>
		<?php endforeach;?>
			<div class="bb" style="margin:5px 0;"><script type="text/javascript" language="Javascript" src="http://a.ava.com.ua/a/showA.js?partner=335&block=700&search=<?php echo str_replace('_', '+', $this->product->getAlias());?>&encoding=utf8&limit=20"></script></div>
		</div>
		<div id="prodCustomDescr" class="box">
			<table cols="2" class="width100">
			<tr>
				<td colspan="2" style="text-align:left;">
					<div id="mixkt_4294944591"></div>
				</td>
			</tr>
			<?php foreach ($this->product->getCustomFields()->getProductGroups() as $index => $group):?>
			<tr class="bb">
				<th colspan="2" style="text-align:left;"><?php echo $group['title'];?></th>
			</tr>
			<tr>
				<td>
					<table class="width100">
					<?php foreach ($group['fields'] as $field):?>
						<?php if (!empty($field['values'])):?>
						<tr>
							<td width="50%"><em><?php echo $field['title'];?></em></td>
							<td class="prodValue">
							<?php foreach ($field['values'] as $valueId => $value):?>
								<a href="<?php echo $this->url(array('module' => 'catalog', 'controller'=>'categories', 'action'=>'list'), null, true);?>/category/<?php echo $this->category->getAlias();?>?<?php echo $field['alias'];?>=<?php echo $valueId;?>" title="<?php echo $field['title'];?>"><?php echo $value;?></a><?php if (end($field['values']) != $value) echo ' | ';?>
							<?php endforeach;?>
							</td>
						</tr>
						<?php endif;?>
					<?php endforeach;?>
					</table>
				</td>
			</tr>
			<?php endforeach;?>
			</table>
		</div>
	</div>
</div>
